﻿using System;
using System.Collections.Generic;
using Framework.DataObjects;

namespace Framework.FluentTextStringBuilder
{
    public interface ITextStringBuilderWriterFluent
    {
        TextStringBuilder Instance { get; set; }
        
        /// <summary>
        /// Swich context Configs this instance.
        /// </summary>
        /// <returns></returns>
        ITextStringBuilderConfigurationFluent Config();

        /// <summary>
        /// Set settings for instance then go back to string builder
        /// </summary>
        /// <param name="indentPosition">The indent position.</param>
        /// <param name="indentText">The indent text.</param>
        /// <param name="newLine">The new line.</param>
        /// <param name="dividerCharacter">The divider character.</param>
        /// <param name="dividerlength">The dividerlength.</param>
        /// <param name="nameValueSeperater">The name value seperater.</param>
        /// <param name="nameValuePadding">The name value padding.</param>
        /// <param name="propertyDelimiter">The property delimiter.</param>
        /// <param name="enclosureHasIndentation">if set to <c>true</c> [enclosure has indentation].</param>
        /// <param name="enclosureHasNewLine">if set to <c>true</c> [enclosure has new line].</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent ConfigSettings
            (
                int indentPosition = 0,
                string indentText = "    ",
                string newLine = FrameworkConstant.CRLF,
                char dividerCharacter = '-',
                int dividerlength = 100,
                string nameValueSeperater = ": ",
                int nameValuePadding = 30,
                ReplacePropertyDelimiterType propertyDelimiter = ReplacePropertyDelimiterType.Brace,
                bool enclosureHasIndentation = true,
                bool enclosureHasNewLine = true
            );


        /// <summary>
        /// Prints the current state of the internal buffer to console
        /// </summary>
        /// <returns></returns>
        ITextStringBuilderWriterFluent Print();

        // *********************************************************************************
        // Indent
        // *********************************************************************************

        /// <summary>
        /// Indents to the specified position.
        /// </summary>
        /// <param name="indentPosition"></param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent Indent(int indentPosition);

        /// <summary>
        /// Indents to the left (1 position).
        /// </summary>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IndentLeft();

        /// <summary>
        /// Indents to the left (Outdent).
        /// </summary>
        /// <param name="indentOffset">The indent offset.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IndentLeft(int indentOffset);

        /// <summary>
        /// Indents to the right (1 position).
        /// </summary>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IndentRight();

        /// <summary>
        /// Indents to the right.
        /// </summary>
        /// <param name="indentOffset">The indent offset.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IndentRight(int indentOffset);

        // *********************************************************************************
        // Enclosure
        // *********************************************************************************

        /// <summary>
        /// Open Enclosure.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent EnclosureOpen(string value);

        /// <summary>
        /// Close Enclosure.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent EnclosureClose(string value);

        // *********************************************************************************
        // Add
        // *********************************************************************************

        ITextStringBuilderWriterFluent Add(bool value);

        /// <summary>Adds a character to the text stream.</summary>
        /// <param name="value">The character to write. </param>
        ITextStringBuilderWriterFluent Add(char value);

        /// <summary>Adds a character array to the text stream.</summary>
        /// <param name="value">The character array to write. </param>
        ITextStringBuilderWriterFluent Add(char[] value);

        /// <summary>Adds the text representation of a Double to the text stream.</summary>
        /// <param name="value">The double to write. </param>
        ITextStringBuilderWriterFluent Add(double value);

        /// <summary>Adds the text representation of an integer to the text stream.</summary>
        /// <param name="value">The integer to write. </param>
        ITextStringBuilderWriterFluent Add(int value);

        /// <summary>Adds the text representation of an 8-byte integer to the text stream.</summary>
        /// <param name="value">The 8-byte integer to write. </param>
        ITextStringBuilderWriterFluent Add(long value);

        /// <summary>Adds the text representation of an object to the text stream.</summary>
        /// <param name="value">The object to write. </param>
        ITextStringBuilderWriterFluent Add(object value);

        /// <summary>Adds the text representation of a Single to the text stream.</summary>
        /// <param name="value">The single to write. </param>
        ITextStringBuilderWriterFluent Add(float value);

        /// <summary>Adds the text representation of a Single to the text stream.</summary>
        /// <param name="value">The single to write. </param>
        ITextStringBuilderWriterFluent Add(decimal value);

        /// <summary>Adds the specified string to the text stream.</summary>
        /// <param name="value">The string to write. </param>
        ITextStringBuilderWriterFluent Add(string value);

        /// <summary>
        /// Adds a list of string values to the text stream.
        /// </summary>
        /// <param name="values">The values.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent Add(List<string> values);

        /// <summary>Adds out a formatted string, using the same semantics as specified.</summary>
        /// <param name="args">The argument array to output. </param>;
        /// <param name="format">The formatting string to use. </param>
        ITextStringBuilderWriterFluent Add(string format, params object[] args);

        /// <summary>Adds a subarray of characters to the text stream.</summary>
        /// <param name="value">The character array to write data from. </param>;
        /// <param name="index">Starting index in the buffer. </param>
        /// <param name="count">The number of characters to write. </param>
        ITextStringBuilderWriterFluent Add(char[] value, int index, int count);

        // *********************************************************************************
        // AddLine
        // *********************************************************************************

        /// <summary>Adds a boolean to the text stream, followed by a line terminator.</summary>
        /// <returns></returns>
        ITextStringBuilderWriterFluent AddLine();

        /// <summary>
        /// Adds a boolean to the text stream, followed by a line terminator.
        /// </summary>
        /// <param name="options">The options.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent AddLine(FTSBAddOptionType options);

        /// <summary>Adds a boolean to the text stream, followed by a line terminator.</summary>
        /// <param name="value">if set to <c>true</c> [value].</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent AddLine(bool value);

        /// <summary>
        /// Adds a boolean to the text stream, followed by a line terminator.
        /// </summary>
        /// <param name="options">The options.</param>
        /// <param name="value">if set to <c>true</c> [value].</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent AddLine(FTSBAddOptionType options, bool value);

        /// <summary>Adds a character to the text stream, followed by a line terminator.</summary>
        /// <param name="value">The character to write. </param>
        ITextStringBuilderWriterFluent AddLine(char value);

        /// <summary>
        /// Adds a character to the text stream, followed by a line terminator.
        /// </summary>
        /// <param name="options">The options.</param>
        /// <param name="value">The character to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent AddLine(FTSBAddOptionType options, char value);

        /// <summary>Adds a character array to the text stream, followed by a line terminator.</summary>
        /// <param name="value">The character array to write. </param>
        ITextStringBuilderWriterFluent AddLine(char[] value);

        /// <summary>
        /// Adds a character array to the text stream, followed by a line terminator.
        /// </summary>
        /// <param name="options">The options.</param>
        /// <param name="value">The character array to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent AddLine(FTSBAddOptionType options, char[] value);

        /// <summary>Adds the text representation of a Double to the text stream, followed by a line terminator.</summary>
        /// <param name="value">The double to write. </param>
        ITextStringBuilderWriterFluent AddLine(double value);

        /// <summary>
        /// Adds the text representation of a Double to the text stream, followed by a line terminator.
        /// </summary>
        /// <param name="options">The options.</param>
        /// <param name="value">The double to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent AddLine(FTSBAddOptionType options, double value);

        /// <summary>Adds the text representation of an integer to the text stream, followed by a line terminator.</summary>
        /// <param name="value">The integer to write. </param>
        ITextStringBuilderWriterFluent AddLine(int value);

        /// <summary>
        /// Adds the text representation of an integer to the text stream, followed by a line terminator.
        /// </summary>
        /// <param name="options">The options.</param>
        /// <param name="value">The integer to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent AddLine(FTSBAddOptionType options, int value);

        /// <summary>Adds the text representation of an 8-byte integer to the text stream, followed by a line terminator.</summary>
        /// <param name="value">The 8-byte integer to write. </param>
        ITextStringBuilderWriterFluent AddLine(long value);

        /// <summary>
        /// Adds the text representation of an 8-byte integer to the text stream, followed by a line terminator.
        /// </summary>
        /// <param name="options">The options.</param>
        /// <param name="value">The 8-byte integer to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent AddLine(FTSBAddOptionType options, long value);

        /// <summary>Adds the text representation of an object to the text stream, followed by a line terminator.</summary>
        /// <param name="value">The object to write. </param>
        ITextStringBuilderWriterFluent AddLine(object value);

        /// <summary>
        /// Adds the text representation of an object to the text stream, followed by a line terminator.
        /// </summary>
        /// <param name="options">The options.</param>
        /// <param name="value">The object to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent AddLine(FTSBAddOptionType options, object value);

        /// <summary>Adds the text representation of a Single to the text stream, followed by a line terminator.</summary>
        /// <param name="value">The single to write. </param>
        ITextStringBuilderWriterFluent AddLine(float value);

        /// <summary>
        /// Adds the text representation of a Single to the text stream, followed by a line terminator.
        /// </summary>
        /// <param name="options">The options.</param>
        /// <param name="value">The single to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent AddLine(FTSBAddOptionType options, float value);

        /// <summary>Adds the text representation of a Single to the text stream, followed by a line terminator.</summary>
        /// <param name="value">The single to write. </param>
        ITextStringBuilderWriterFluent AddLine(decimal value);

        /// <summary>
        /// Adds the text representation of a Single to the text stream, followed by a line terminator.
        /// </summary>
        /// <param name="options">The options.</param>
        /// <param name="value">The single to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent AddLine(FTSBAddOptionType options, decimal value);

        /// <summary>Adds the specified string to the text stream, followed by a line terminator.</summary>
        /// <param name="value">The string to write. </param>
        ITextStringBuilderWriterFluent AddLine(string value);

        /// <summary>
        /// Adds the specified string to the text stream, followed by a line terminator.
        /// </summary>
        /// <param name="options">The options.</param>
        /// <param name="value">The string to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent AddLine(FTSBAddOptionType options, string value);

        /// <summary>
        /// Adds a list of string values to the text stream, followed by a line terminator for each string.
        /// </summary>
        /// <param name="values">The values.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent AddLine(List<string> values);

        /// <summary>
        /// Adds a list of string values to the text stream, followed by a line terminator for each string.
        /// </summary>
        /// <param name="options">The options.</param>
        /// <param name="values">The values.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent AddLine(FTSBAddOptionType options, List<string> values);

        /// <summary>Adds out a formatted string, using the same semantics as specified.</summary>
        /// <param name="args">The argument array to output. </param>;
        /// <param name="format">The formatting string to use. </param>
        ITextStringBuilderWriterFluent AddLine(string format, params object[] args);

        /// <summary>
        /// Adds out a formatted string, using the same semantics as specified.
        /// </summary>
        /// <param name="options">The options.</param>
        /// <param name="format">The formatting string to use.</param>
        /// <param name="args">The argument array to output.</param>
        /// <returns></returns>
        /// ;
        ITextStringBuilderWriterFluent AddLine(FTSBAddOptionType options, string format, params object[] args);

        /// <summary>Adds a subarray of characters to the text stream, followed by a line terminator.</summary>
        /// <param name="value">The character array to write data from. </param>;
        /// <param name="index">Starting index in the buffer. </param>
        /// <param name="count">The number of characters to write. </param>
        ITextStringBuilderWriterFluent AddLine(char[] value, int index, int count);

        /// <summary>
        /// Adds a subarray of characters to the text stream, followed by a line terminator.
        /// </summary>
        /// <param name="options">The options.</param>
        /// <param name="value">The character array to write data from.</param>
        /// <param name="index">Starting index in the buffer.</param>
        /// <param name="count">The number of characters to write.</param>
        /// <returns></returns>
        /// ;
        ITextStringBuilderWriterFluent AddLine(FTSBAddOptionType options, char[] value, int index, int count);

        // *********************************************************************************
        // IfAdd
        // *********************************************************************************

        ITextStringBuilderWriterFluent IfAdd(bool isTrue, bool value);

        /// <summary>
        /// If condition is met, Adds a character to the text stream.
        /// </summary>
        /// <param name="isTrue">if set to <c>true</c> [is true].</param>
        /// <param name="value">The character to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IfAdd(bool isTrue, char value);

        /// <summary>
        /// If condition is met, Adds a character array to the text stream.
        /// </summary>
        /// <param name="isTrue">if set to <c>true</c> [is true].</param>
        /// <param name="value">The character array to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IfAdd(bool isTrue, char[] value);

        /// <summary>
        /// If condition is met, Adds the text representation of a Double to the text stream.
        /// </summary>
        /// <param name="isTrue">if set to <c>true</c> [is true].</param>
        /// <param name="value">The double to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IfAdd(bool isTrue, double value);

        /// <summary>
        /// If condition is met, Adds the text representation of an integer to the text stream.
        /// </summary>
        /// <param name="isTrue">if set to <c>true</c> [is true].</param>
        /// <param name="value">The integer to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IfAdd(bool isTrue, int value);

        /// <summary>
        /// If condition is met, Adds the text representation of an 8-byte integer to the text stream.
        /// </summary>
        /// <param name="isTrue">if set to <c>true</c> [is true].</param>
        /// <param name="value">The 8-byte integer to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IfAdd(bool isTrue, long value);

        /// <summary>
        /// If condition is met, Adds the text representation of an object to the text stream.
        /// </summary>
        /// <param name="isTrue">if set to <c>true</c> [is true].</param>
        /// <param name="value">The object to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IfAdd(bool isTrue, object value);

        /// <summary>
        /// If condition is met, Adds the text representation of a Single to the text stream.
        /// </summary>
        /// <param name="isTrue">if set to <c>true</c> [is true].</param>
        /// <param name="value">The single to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IfAdd(bool isTrue, float value);

        /// <summary>
        /// If condition is met, Adds the text representation of a Single to the text stream.
        /// </summary>
        /// <param name="isTrue">if set to <c>true</c> [is true].</param>
        /// <param name="value">The single to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IfAdd(bool isTrue, decimal value);

        /// <summary>
        /// Adds the specified string to the text stream.
        /// </summary>
        /// <param name="isTrue">if set to <c>true</c> [is true].</param>
        /// <param name="value">The string to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IfAdd(bool isTrue, string value);

        /// <summary>
        /// If condition is met, Adds out a formatted string, using the same semantics as specified.
        /// </summary>
        /// <param name="isTrue">if set to <c>true</c> [is true].</param>
        /// <param name="format">The formatting string to use.</param>
        /// <param name="args">The argument array to output.</param>
        /// <returns></returns>
        /// ;
        ITextStringBuilderWriterFluent IfAdd(bool isTrue, string format, params object[] args);

        /// <summary>
        /// If condition is met, Adds a subarray of characters to the text stream.
        /// </summary>
        /// <param name="isTrue">if set to <c>true</c> [is true].</param>
        /// <param name="value">The character array to write data from.</param>
        /// <param name="index">Starting index in the buffer.</param>
        /// <param name="count">The number of characters to write.</param>
        /// <returns></returns>
        /// ;
        ITextStringBuilderWriterFluent IfAdd(bool isTrue, char[] value, int index, int count);

        // *********************************************************************************
        // IfAddLine
        // *********************************************************************************

        /// <summary>Adds line terminator to stream.</summary>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IfAddLine(bool isTrue);

        /// <summary>
        /// If condition is met, Adds a boolean to the text stream, followed by a line terminator.
        /// </summary>
        /// <param name="isTrue">if set to <c>true</c> [is true].</param>
        /// <param name="value">if set to <c>true</c> [value].</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IfAddLine(bool isTrue, bool value);

        /// <summary>
        /// If condition is met, Adds a character to the text stream, followed by a line terminator.
        /// </summary>
        /// <param name="isTrue">if set to <c>true</c> [is true].</param>
        /// <param name="value">The character to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IfAddLine(bool isTrue, char value);

        /// <summary>
        /// If condition is met, Adds a character array to the text stream, followed by a line terminator.
        /// </summary>
        /// <param name="isTrue">if set to <c>true</c> [is true].</param>
        /// <param name="value">The character array to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IfAddLine(bool isTrue, char[] value);

        /// <summary>
        /// If condition is met, Adds the text representation of a Double to the text stream, followed by a line terminator.
        /// </summary>
        /// <param name="isTrue">if set to <c>true</c> [is true].</param>
        /// <param name="value">The double to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IfAddLine(bool isTrue, double value);

        /// <summary>
        /// If condition is met, Adds the text representation of an integer to the text stream, followed by a line terminator.
        /// </summary>
        /// <param name="isTrue">if set to <c>true</c> [is true].</param>
        /// <param name="value">The integer to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IfAddLine(bool isTrue, int value);

        /// <summary>
        /// If condition is met, Adds the text representation of an 8-byte integer to the text stream, followed by a line terminator.
        /// </summary>
        /// <param name="isTrue">if set to <c>true</c> [is true].</param>
        /// <param name="value">The 8-byte integer to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IfAddLine(bool isTrue, long value);

        /// <summary>
        /// If condition is met, Adds the text representation of an object to the text stream, followed by a line terminator.
        /// </summary>
        /// <param name="isTrue">if set to <c>true</c> [is true].</param>
        /// <param name="value">The object to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IfAddLine(bool isTrue, object value);

        /// <summary>
        /// If condition is met, Adds the text representation of a Single to the text stream, followed by a line terminator.
        /// </summary>
        /// <param name="isTrue">if set to <c>true</c> [is true].</param>
        /// <param name="value">The single to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IfAddLine(bool isTrue, float value);

        /// <summary>
        /// If condition is met, Adds the text representation of a Single to the text stream, followed by a line terminator.
        /// </summary>
        /// <param name="isTrue">if set to <c>true</c> [is true].</param>
        /// <param name="value">The single to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IfAddLine(bool isTrue, decimal value);

        /// <summary>
        /// If condition is met, Adds the specified string to the text stream, followed by a line terminator.
        /// </summary>
        /// <param name="isTrue">if set to <c>true</c> [is true].</param>
        /// <param name="value">The string to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IfAddLine(bool isTrue, string value);

        /// <summary>
        /// If condition is met, Adds out a formatted string, using the same semantics as specified.
        /// </summary>
        /// <param name="isTrue">if set to <c>true</c> [is true].</param>
        /// <param name="format">The formatting string to use.</param>
        /// <param name="args">The argument array to output.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IfAddLine(bool isTrue, string format, params object[] args);

        /// <summary>
        /// If condition is met, Adds a subarray of characters to the text stream, followed by a line terminator.
        /// </summary>
        /// <param name="isTrue">if set to <c>true</c> [is true].</param>
        /// <param name="value">The character array to write data from.</param>
        /// <param name="index">Starting index in the buffer.</param>
        /// <param name="count">The number of characters to write.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent IfAddLine(bool isTrue, char[] value, int index, int count);

        // *********************************************************************************
        // IfIndent
        // *********************************************************************************

        /// <summary>
        /// Indents to the specified position, if condition is met
        /// </summary>
        ITextStringBuilderWriterFluent IfIndent(bool isTrue, int indentPosition);

        /// <summary>
        /// Indents to the left (1 position), if condition is met
        /// </summary>
        ITextStringBuilderWriterFluent IfIndentLeft(bool isTrue);

        /// <summary>
        /// Indents to the left, if condition is met
        /// </summary>
        ITextStringBuilderWriterFluent IfIndentLeft(bool isTrue, int indentPosition);

        /// <summary>
        /// Indents to the right (1 position), if condition is met
        /// </summary>
        ITextStringBuilderWriterFluent IfIndentRight(bool isTrue);

        /// <summary>
        /// Indents to the right, if condition is met
        /// </summary>
        ITextStringBuilderWriterFluent IfIndentRight(bool isTrue, int indentPosition);

        // *********************************************************************************
        // NameValue 
        // *********************************************************************************

        /// <summary>
        /// Adds name/value pair to the text stream.
        /// </summary>
        /// <returns></returns>
        ITextStringBuilderWriterFluent NameValue(string name, string value);

        /// <summary>
        /// Adds name/value pair to the text stream.
        /// </summary>
        /// <returns></returns>
        ITextStringBuilderWriterFluent NameValue(string name, int value);

        /// <summary>
        /// Adds name/value pair to the text stream.
        /// </summary>
        /// <returns></returns>
        ITextStringBuilderWriterFluent NameValue(string name, float value);

        /// <summary>
        /// Adds name/value pair to the text stream.
        /// </summary>
        /// <returns></returns>
        ITextStringBuilderWriterFluent NameValue(string name, decimal value);

        /// <summary>
        /// Adds name/value pair to the text stream.
        /// </summary>
        /// <returns></returns>
        ITextStringBuilderWriterFluent NameValue(string name, double value);

        /// <summary>
        /// Adds name/value pair to the text stream.
        /// </summary>
        /// <returns></returns>
        ITextStringBuilderWriterFluent NameValue(string name, bool value);

        /// <summary>
        /// Adds name/value pair to the text stream.
        /// </summary>
        /// <returns></returns>
        ITextStringBuilderWriterFluent NameValue(string name, DateTime? value);

        /// <summary>
        /// Adds name/value pair to the text stream.
        /// </summary>
        /// <returns></returns>
        ITextStringBuilderWriterFluent NameValue(string name, Enum value);

        // *********************************************************************************
        // NameValueLine
        // *********************************************************************************

        /// <summary>
        /// Adds name/value pair to the text stream, followed by a line terminator.
        /// </summary>
        /// <returns></returns>
        ITextStringBuilderWriterFluent NameValueLine(string name, string value);

        /// <summary>
        /// Adds name/value pair to the text stream, followed by a line terminator.
        /// </summary>
        /// <returns></returns>
        ITextStringBuilderWriterFluent NameValueLine(string name, int value);

        /// <summary>
        /// Adds name/value pair to the text stream, followed by a line terminator.
        /// </summary>
        /// <returns></returns>
        ITextStringBuilderWriterFluent NameValueLine(string name, float value);

        /// <summary>
        /// Adds name/value pair to the text stream, followed by a line terminator.
        /// </summary>
        /// <returns></returns>
        ITextStringBuilderWriterFluent NameValueLine(string name, decimal value);

        /// <summary>
        /// Adds name/value pair to the text stream, followed by a line terminator.
        /// </summary>
        /// <returns></returns>
        ITextStringBuilderWriterFluent NameValueLine(string name, double value);

        /// <summary>
        /// Adds name/value pair to the text stream, followed by a line terminator.
        /// </summary>
        /// <returns></returns>
        ITextStringBuilderWriterFluent NameValueLine(string name, bool value);

        /// <summary>
        /// Adds name/value pair to the text stream, followed by a line terminator.
        /// </summary>
        /// <returns></returns>
        ITextStringBuilderWriterFluent NameValueLine(string name, DateTime? value);

        /// <summary>
        /// Adds name/value pair to the text stream, followed by a line terminator.
        /// </summary>
        /// <returns></returns>
        ITextStringBuilderWriterFluent NameValueLine(string name, Enum value);

        // *********************************************************************************
        // Divider
        // *********************************************************************************

        /// <summary>
        /// Writes a dividing line to the text stream, followed by a line terminator.
        /// </summary>
        /// <param name="isTerminator">if set to <c>true</c> [is terminator].</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent Divider(bool isTerminator = true);

        /// <summary>
        /// Writes a dividing line to the text stream with a heading, followed by a line terminator.
        /// </summary>
        /// <param name="heading">The heading.</param>
        /// <param name="isTerminator">if set to <c>true</c> [is terminator].</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent Divider(string heading, bool isTerminator = true);

        // *********************************************************************************
        // Expand Template
        // *********************************************************************************

        /// <summary>
        /// Writes the contents of a template using key/values supplied to expand the template tokens.
        /// </summary>
        /// <param name="template">The template.</param>
        /// <param name="keyValues">The key values.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent Template(string template, params string[] keyValues);

        /// <summary>
        /// Writes the contents of a template using key/values supplied to expand the template tokens.
        /// </summary>
        /// <param name="template">The template.</param>
        /// <param name="keyValues">The key values.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent Template(string template, IDictionary<string, string> keyValues);

        /// <summary>
        /// Writes the contents of a template using key/values supplied to expand the template tokens.
        /// </summary>
        /// <param name="template">The template.</param>
        /// <param name="tokenReplacer">The token replacer.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent Template(string template, ITokenReplacer tokenReplacer);

        /// <summary>
        /// Adds the content of a file to the buffer.
        /// </summary>
        /// <param name="fileName">Name of the file.</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent AddFile(string fileName);

        /// <summary>
        /// Adds the file.
        /// </summary>
        /// <param name="fileName">Name of the file.</param>
        /// <param name="isRetainIndent">if set to <c>true</c> [is retain indent].</param>
        /// <returns></returns>
        ITextStringBuilderWriterFluent AddFile(string fileName, bool isRetainIndent);
    }
}